﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Collections;

namespace Usas.Common.Cms
{
    public class CurrentInfo : System.Web.UI.Page
    {
        public CurrentInfo()
        {
         

            
        }

        public string GetDepartmentId()
        {
            return Session["DptId"] != null ? Session["DptId"].ToString() : "";
        }

        public string GetEmpId()
        {
            return Session["EmpId"] != null ? Session["EmpId"].ToString() : "";
        }

        public string GetEmpPwd()
        {
            return Session["EmpPwd"] != null ? Session["EmpPwd"].ToString() : "";
        }

        public string GetEmpName()
        {
            return Session["EmpName"] != null ? Session["EmpName"].ToString() : "";
        }

        public string GetLoginDB()
        {
            return Session["DB"] != null ? Session["DB"].ToString() : "";
        }

        public string GetLoginProject()
        {
            return Session["Project"] != null ? Session["Project"].ToString() : "";
        }

        public object GetLoginPurViewSys1OprKey()
        {
            return Session["LoginPurViewSys1OprKey"] != null ? Session["LoginPurViewSys1OprKey"] : null;
        }

        public ArrayList GetEmpRole()
        {
            try
            {
                if (((ArrayList)Session["EmpRole"]).Count > 0)
                {
                    return Session["EmpRole"] as ArrayList;
                }
                else
                {
                   return null;
                }
            }
            catch
            {
                return null;
            }
        }

        public bool GetAdminGroup()
        {
            if (Session["CmsGroup"] != null)
            {
                SortedList std = (SortedList)Session["CmsGroup"];
                return Convert.ToBoolean(std["AdminGroup"]);
            }
            else
            {
                return false;
            }
        }

        public bool GetTimeSheetGroup()
        {
            if (Session["CmsGroup"] != null)
            {
                SortedList std = (SortedList)Session["CmsGroup"];
                return Convert.ToBoolean(std["TimeSheetGroup"]);
            }
            else
            {
                return false;
            }
        }

        public bool GetSuperAdminGroup()
        {
            if (Session["CmsGroup"] != null)
            {
                SortedList std = (SortedList)Session["CmsGroup"];
                return Convert.ToBoolean(std["SuperAdminGroup"]);
            }
            else
            {
                return false;
            }
        }
    }
}
